<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
		person=new Object();
		person.firstname="Bill";
		person.lastname="Gates";
		person.age=56;
		person.eyecolor="blue";
		//alert(person.age);
		
		person.show=function(){
			alert("姓名："+this.firstname+" "+this.lastname+",age="+this.age);
		}
		
		person.show();
		//改年龄的方法
		person.changeAge=function(n){
			this.age=n;
		}
		person.changeAge(58);
		person.show();
		class Dog{
			 
			constructor(n,a){
				this.name=n;
				this.age=a;
			}
			 shout(){
				alert(this.name+"在叫唤.他的年龄是"+this.age+"岁");
			}
		}
		class XizaoDog extends Dog{
			bite(n){
				alert(this.name+"狠狠的咬了"+n);
			}
		}
		
		var d=new Dog("哮天犬",3000);
		d.shout();
		
		var d2=new XizaoDog("小花花",4);
		d2.shout();
		d2.bite("小刺猬");
		</script>
	</head>
	<body>
	</body>
</html>
